package com.twu.biblioteca;

import java.util.List;
import java.util.Scanner;

/**
 * Created by sravanns on 12/06/14.
 */

/*job: represents how everything should be displayed*/
public class UIApplication implements UserInterface {




    @Override
    public int acceptChoice() {
        Scanner scan = new Scanner(System.in);
        return scan.nextInt();
    }

    @Override
    public String acceptTitle() {
        Scanner scan = new Scanner(System.in);
        return scan.next().trim();
    }

    @Override
    public boolean display(String message_to_be_printed) {
        System.out.println(message_to_be_printed);
        return true;
    }

    @Override
    public boolean displayMenu(List menu) {
        int index=0;
        display("\n");
        for (Object menuItem :menu) {
            display(String.valueOf(index++)+" " +menuItem+"\n");
        }
        return true;
    }



    @Override
    public boolean displayBooks(List books) {
        for (Object book : books) {
            display(book.toString());
            //display("\n-------\n");
        }

        return true;
    }

    @Override
    public boolean displayMenuActionResult(String message) {
        display(message);
        return true;
    }

    @Override
    public boolean displayMovies(List<Movie> movies) {
        for (Object movie : movies) {
            display(movie.toString());
           // display("\n-------\n");
        }

        return true;
    }


    public String acceptUserName() {
        Scanner scan = new Scanner(System.in);
        return scan.next().trim();

    }

    public String acceptPassword() {
        Scanner scan = new Scanner(System.in);return scan.next().trim();
    }

    public String acceptEmail() {
        Scanner scan = new Scanner(System.in);return scan.next().trim();
    }

    public String acceptPhone() { Scanner scan = new Scanner(System.in);
        return scan.next();


    }

    public String acceptLibraryNumber() {
        Scanner scan = new Scanner(System.in);
        return scan.next().trim();
    }
}
